android.ndk.native_window

@file native_window.h @brief API for accessing a native window.

Members

Enums

ANativeWindowTransform
enum ANativeWindowTransform

Transforms that can be applied to buffers as they are displayed to a window.

ANativeWindow_LegacyFormat
enum ANativeWindow_LegacyFormat

Legacy window pixel format names, kept for backwards compatibility. New code and APIs should use AHARDWAREBUFFER_FORMAT_*.

Functions

ANativeWindow_acquire
void ANativeWindow_acquire(ANativeWindow* window)

Acquire a reference on the given {@link ANativeWindow} object. This prevents the object from being deleted until the reference is removed.

ANativeWindow_getBuffersDataSpace
int ANativeWindow_getBuffersDataSpace(ANativeWindow* window)

Get the dataspace of the buffers in window. \return the dataspace of buffers in window, ADATASPACE_UNKNOWN is returned if dataspace is unknown, or -EINVAL if window is invalid.

ANativeWindow_getFormat
int ANativeWindow_getFormat(ANativeWindow* window)

Return the current pixel format (AHARDWAREBUFFER_FORMAT_*) of the window surface.

ANativeWindow_getHeight
int ANativeWindow_getHeight(ANativeWindow* window)

Return the current height in pixels of the window surface.

ANativeWindow_getWidth
int ANativeWindow_getWidth(ANativeWindow* window)

Return the current width in pixels of the window surface.

ANativeWindow_lock
int ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds)

Lock the window's next drawing surface for writing. inOutDirtyBounds is used as an in/out parameter, upon entering the function, it contains the dirty region, that is, the region the caller intends to redraw. When the function returns, inOutDirtyBounds is updated with the actual area the caller needs to redraw -- this region is often extended by {@link ANativeWindow_lock}.

ANativeWindow_release
void ANativeWindow_release(ANativeWindow* window)

Remove a reference that was previously acquired with {@link ANativeWindow_acquire()}.

ANativeWindow_setBuffersDataSpace
int ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int dataSpace)

All buffers queued after this call will be associated with the dataSpace parameter specified.

ANativeWindow_setBuffersGeometry
int ANativeWindow_setBuffersGeometry(ANativeWindow* window, int width, int height, int format)

Change the format and size of the window buffers.

ANativeWindow_setBuffersTransform
int ANativeWindow_setBuffersTransform(ANativeWindow* window, int transform)

Set a transform that will be applied to future buffers posted to the window.

ANativeWindow_unlockAndPost
int ANativeWindow_unlockAndPost(ANativeWindow* window)

Unlock the window's drawing surface after previously locking it, posting the new buffer to the display.

Structs

ANativeWindow_Buffer
struct ANativeWindow_Buffer

Struct that represents a windows buffer.

Meta